#ifndef __FIELD_H__
#define __FIELD_H__

#include <vector>
#include <SDL/SDL.h>
#include <rapidxml.hpp>
#include "config.h"
#include "error.h"
#include "texture.h"
#include "objtable.h"
#include "texel.h"

class Field : protected std::vector<Texel> {
	public:
		Field();
		virtual ~Field();
		void Load (const std::string & file, ObjTable & objTbl);
		void Draw (SDL_Surface * screen);
		void HandleTick(unsigned time);
		void Explode (int x, int y, int damage, int radius);
		Texel & operator() (int  x, int  y);
	private:
		rapidxml::xml_document<> xml;
		std::vector<char> xmlBuf;
		int width;
		int height;
};



#endif
